﻿<UserControl x:Class="Helper.Controls.VlcPlayer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             Background="White" 
            MinHeight="240" MinWidth="320"
             xmlns:vlc="clr-namespace:Vlc.DotNet.Wpf;assembly=Vlc.DotNet.Wpf">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="70"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" Background="Black">
            <vlc:VlcControl Name="myVlcControl"/>
            <Image Stretch="Uniform" Source="{Binding ElementName=myVlcControl, Path=VideoSource}"/>
        </Grid>

        <Grid Grid.Row="2" Background="{DynamicResource Accent}">
            <Slider Margin="20,0,220,0" VerticalAlignment="Center" Name="position"
                    Maximum="1" LargeChange="0.05" ValueChanged="SliderValueChanged" 
                    PreviewMouseLeftButtonDown="SliderMouseLeftButtonDown" 
                    PreviewMouseLeftButtonUp="SliderMouseLeftButtonUp"
                    SmallChange="0.01" />
            
            <Button HorizontalAlignment="Right" Margin="0,25,192,25" VerticalAlignment="Center" Height="20"
                    Style="{DynamicResource SystemButtonBase}" Click="OnClickPlay">
                <Path Stretch="Uniform" Fill="Black" Data="F1 M 26.9167,23.75L 33.25,23.75L 33.25,52.25L 26.9167,52.25L 26.9167,23.75 Z M 42.75,23.75L 49.0833,23.75L 49.0833,52.25L 42.75,52.25L 42.75,23.75 Z "/>
            </Button>
            <Button HorizontalAlignment="Right" Margin="0,0,160,0" VerticalAlignment="Center" Height="20"
                    Style="{DynamicResource SystemButtonBase}" Click="OnClickStop">
                <Rectangle Width="17" Height="18" Stretch="Uniform" Fill="Black"/>
            </Button>
            <TextBlock Name="durationText" HorizontalAlignment="Right" Margin="0,0,10,0" Text="00:00:00" VerticalAlignment="Center"
                       Style="{DynamicResource Emphasis2}"/>

        </Grid>
    </Grid>
</UserControl>
